package com.sy.service.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.sy.dao.BaseDao;
import com.sy.service.BaseService;

@SuppressWarnings("unchecked")
public class BaseServiceImpl implements BaseService {

//日志
	protected final Log log = LogFactory.getLog(getClass());
	private BaseDao dao ;

//获得Dao
	public void setDao(BaseDao basedao) {
		this.dao = basedao;
	}

//传出Dao
	public Object getObject(Class clazz, Integer id) {
		return dao.getObject(clazz, id);
	}

//传出Dao列
	public List getObjects(Class clazz) {
		if(this.dao ==null){
	    	log.debug("=========shiyang");
	    	}
	        return this.dao.getObjects(clazz);
	}

//删除
	public void removeObject(Class clazz, Integer id) {
		 dao.removeObject(clazz, id);
	}

//保存
	public void saveAllObject(List list) {
		dao.saveOrUpdateAll(list);
	}

//添加
	public void saveObject(Object o) {
		dao.addObject(o);
	}
}